// 公司 测试
const dev = {
    mysqlConfig: {
        host: '192.168.1.115',
        port: 3306,
        username: 'xiaozhi1',
        password: 'Admin$11',
        database: 'wanqimiao',
    },
    redisConfig: {
        host: '192.168.1.55',
        port: 6379,
        password: 'Admin$11',
    }
}

// 家 测试
const home = {
    mysqlConfig: {
        host: '127.0.0.1',
        port: 3306,
        username: 'root',
        password: '123456',
        database: 'wanqimiao',

    },
    redisConfig: {
        host: '127.0.0.1',
        port: 6379,
        password: '123456',
    },
}

// 希桐文化 正式
const pro = {
    mysqlConfig: {
        host: '114.55.135.153',
        port: 3306,
        username: 'htvr1lb1',
        password: 'rER75YRMM7nEA3DK',
        database: 'xitongwenhua',
    },
    redisConfig: {
        host: '114.55.135.153',
        port: 6379,
        password: 'rER75YRMM7nEA3DK',
    },
}

const _ = process.env.NODE_ENV
let source: { mysqlConfig: any; redisConfig: any }
switch (_) {
    case 'development':
        source = dev
        break
    case 'production':
        source = pro
        break
    default:
        source = home
}

const Constant = {
    jwt: {
        secret: 'wanqimiao-admin',
        expiresIn: 6 * 60 * 60, // JWT 过期时间  Eg: 60(s), "2 days", "10h", "7d" */
    },
    token_expiry_time: 3 * 24 * 60 * 60, // seconds
    mysqlConfig: source.mysqlConfig,
    redisConfig: source.redisConfig,
    webSocketPort: 8002, // ws 端口
    redis_prefix: 'web-',
    SM_MS_TOKEN: 'lz1lhMjb5wiPWl2ZwuEYVqeHaKg2zo1X',
    SM_MS_URL: 'https://sm.ms/api/v2', // Elliot1 TtQQ.
};

export default Constant
